﻿
namespace SharpTalk.Client.WpfApplication.Controls
{
    using System.Collections.ObjectModel;
    using System.ComponentModel;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Input;
    using Core;
    using Views;

    /// <summary>
    /// Interaction logic for UserListView.xaml
    /// </summary>
    public partial class UserListView : UserControl, IUserListView
    {
        public static readonly DependencyProperty UsersProperty = DependencyProperty.Register("Users", typeof(ObservableCollection<User>), typeof(UserListView));
        public static readonly DependencyProperty ShowUserStatusProperty = DependencyProperty.Register("ShowUserStatus", typeof(bool), typeof(UserListView));
        public static readonly DependencyProperty AddContactCommandProperty = DependencyProperty.Register("AddContactCommand", typeof(ICommand), typeof(UserListView));
        
        public UserListView()
        {
            InitializeComponent();
        }

        public ObservableCollection<User> Users
        {
            get { return GetValue(UsersProperty) as ObservableCollection<User>; }
            set { SetValue(UsersProperty, value); }
        }

        public bool ShowUserStatus
        {
            get { return (bool) GetValue(ShowUserStatusProperty); }
            set { SetValue(ShowUserStatusProperty, value); }
        }

        [DisplayName(@"AddContactCommand")]
        [Description("")]
        public ICommand AddContactCommand
        {
            get { return GetValue(AddContactCommandProperty) as ICommand; }
            set { SetValue(AddContactCommandProperty, value); }
        }
    }
}
